package br.ufrj.ppgi.greco.mapaitem;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class Main extends MapActivity
{
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		this.configMap();
		
		MapView mapa = (MapView) findViewById((R.id.mapview));
		
		Drawable icone = getResources().getDrawable(R.drawable.icon); //define a imagem de cada overlay
		
		List<Hotel> hoteis = new ArrayList<Hotel>();
		hoteis.add(new Hotel(new GeoPoint(-22858084,-43232274),"CCMN","Computação","1")  ); 
		hoteis.add(new Hotel(new GeoPoint(-22861821,-43228734),"CT","Engenharia","2")  );
		hoteis.add(new Hotel(new GeoPoint(-22861881,-43223369),"REITORIA","Arquitetura","3")  );
		hoteis.add(new Hotel(new GeoPoint(-22893511,-43236737),"HOSPITAL","Medicina","4")  );
		
		
		HotelOverlay hotelOverlay = new HotelOverlay(this,hoteis, icone);
		mapa.getOverlays().add(hotelOverlay);
		
		
		
		
	}

	@Override
	protected boolean isRouteDisplayed()
	{
		// TODO Auto-generated method stub
		return false;
	}
	
	
	private void configMap()
	{	
		setContentView(R.layout.main);
		MapView mapView = (MapView) findViewById(R.id.mapview);
		mapView.setBuiltInZoomControls(true);
		
		mapView.getController().setCenter(new GeoPoint(-22857027,-43230386));
		mapView.getController().setZoom(14);	
		
		
		
		
	}
	
	
	
	
}